package grape.common.rest.mvc;

import com.baomidou.mybatisplus.core.metadata.IPage;
import grape.common.exception.ExceptionTools;
import grape.common.tools.ToolService;

/**
 * controller的顶级父类，预留扩展
 * Created by yangwei
 * Created at 2019/7/22 18:26
 */
public abstract class SuperController implements ToolService {

    public void assertPageExist(IPage page){
        if (page == null || isEmpty(page.getRecords())) {
            throw ExceptionTools.dataNotExistRE("暂无数据");
        }
    }
}
